import request from '@/config/axios'

export interface OrderListVO {
  id?: number
  appId: number
  payway: string
  terminal: number
  userId: number
  notifyUrl: string
  mobile: string
  userName: string
  userIp: string
  userRemark: string
  openNum: string
  openLevel: string
  openContent: string
  status: number
  productCount: number
  cancelType: number
  remark: string
  brokerageUserId: number
  payOrderId: number
  payStatus: number
  payTime: string
  payChannelCode: string
  finishTime: string
  cancelTime: string
  totalPrice: number
  payPrice: number
  refundPrice: number
}

// 查询订单列表
export const getOrderListPage = async (params) => {
  return await request.get({ url: `/order/blind-trade-order/page`, params })
}

// 查询订单详情
export const getOrderList = async (id: number) => {
  return await request.get({ url: `/order/blind-trade-order/get?id=` + id })
}

// 新增订单
export const createOrderList = async (data: OrderListVO) => {
  return await request.post({ url: `/order/blind-trade-order/create`, data })
}

// 修改订单
export const updateOrderList = async (data: OrderListVO) => {
  return await request.put({ url: `/order/blind-trade-order/update`, data })
}

// 删除订单
export const deleteOrderList = async (id: number) => {
  return await request.delete({ url: `/order/blind-trade-order/delete?id=` + id })
}

// 导出订单 Excel
export const exportOrderList = async (params) => {
  return await request.download({ url: `/order/blind-trade-order/export-excel`, params })
}
